import request from '@/router/axios';

/**
 * 通过id获取菜单
 * @param {*} data 
 * @returns 
 */
export const get = (data) => request({
  url: '/sys/menu/get',
  method: 'post',
  data
});
/**
 * 分页查询菜单
 * @param {*} data 
 * @returns 
 */
 export const list = (data) => request({
  url: '/sys/menu/list',
  method: 'post',
  data
});
/**
 * 获取菜单树
 * @param {*} data 
 * @returns 
 */
 export const tree = (data) => request({
  url: '/sys/menu/tree',
  method: 'post',
  data: data ? data : {}
});
/**
 * 删除菜单
 * @param {*} data 
 * @returns 
 */
 export const remove = (data) => request({
  url: '/sys/menu/remove',
  method: 'post',
  data
});
/**
 * 添加菜单
 * @param {*} data 
 * @returns 
 */
 export const save = (data) => request({
  url: '/sys/menu/save',
  method: 'post',
  data
});
/**
 * 修改菜单
 * @param {*} data 
 * @returns 
 */
 export const update = (data) => request({
  url: '/sys/menu/update',
  method: 'post',
  data
});